%\ProvidesPackageRCS $Header: beamerouterthemecylinder.sty,v 1.0 2007/08/25 $

%    by J.I. Montijano <monti@unizar.es>
%   and Teresa Mu\~{n}oz  <teresa@unizar.es>
%
% This program can be redistributed and/or modified under the terms
% of the GNU Public License, version 2.

\RequirePackage{tikz}

\mode<presentation>

\ifdefined\beamer@headheight\else\newdimen\beamer@headheight\beamer@headheight=0\baselineskip\fi
\newif\ifbeamer@theme@section
\beamer@theme@sectiontrue
\DeclareOptionBeamer{hidesections}{\csname beamer@theme@sectionfalse\endcsname}
\DeclareOptionBeamer{showsections}{\csname beamer@theme@sectiontrue\endcsname}
\DeclareOptionBeamer{height}{\beamer@headheight=#1}
\ProcessOptionsBeamer

\newcount\initial

\setbeamercolor{section in head/foot}{parent=palette tertiary}
\setbeamercolor{subsection in head/foot}{parent=palette tertiary}
\setbeamercolor{author in head/foot}{parent=palette secondary}
\setbeamercolor{title in head/foot}{parent=palette quaternary}
\setbeamercolor{date in head/foot}{parent=palette secondary}

\setbeamercolor{section in sidebar}{fg=claro!30, bg=oscuro!50!black}
\setbeamercolor{subsection in sidebar}{fg=claro!30, bg=oscuro!50!black}
\setbeamercolor{section in sidebar shaded}{fg=oscuro!70}
\setbeamercolor{author in sidebar}{fg=oscuro!20!black}
\setbeamercolor{title in sidebar}{fg=claro!50}

\usebeamercolor{structure}
\colorlet{oscuro}{structure.fg}
\colorlet{claro}{structure.fg!20}
\usebeamercolor{palette primary}
\colorlet{oscuro}{palette primary.bg}
\colorlet{claro}{palette primary.bg!20}

\reset@font

%
%   =================================       Footline    ====================================
%
\defbeamertemplate*{footline}{cylinder theme}
{%
\ifnum\initial=1\else
\ifdefined\beamer@sidebarwidth\else%
\vskip-50pt
\leavevmode%
\ifbeamer@theme@section%
\hbox{%
\begin{beamercolorbox}[wd=.496\paperwidth,ht=0.215cm,dp=0.1cm]{section in head/foot}
\insertsectionnavigationhorizontal{.496\paperwidth}{\hskip0pt plus1filll}{}%
\end{beamercolorbox}\hskip.008\paperwidth%
\begin{beamercolorbox}[wd=.496\paperwidth,ht=0.215cm,dp=0.1cm]{section in head/foot}%
\insertsubsectionnavigationhorizontal{.496\paperwidth}{}{\hskip0pt plus1filll}%
\end{beamercolorbox}}%
\vskip0pt%
\fi%
\hbox{%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=0.22cm,dp=0.07cm,center]{author in head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=0.22cm,dp=0.07cm,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=0.22cm,dp=0.07cm,right]{date in head/foot}%
\usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
\insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}}%
\vskip0pt%
\fi\fi\global\initial=0}
%
%   ===================================   Background     ===================================
%
\defbeamertemplate*{background}{cylinder theme}{%
\usebeamercolor{palette primary}\colorlet{oscuro}{palette primary.bg}\colorlet{claro}{palette primary.bg!20}%
%
\ifnum\initial=1%               Background for title page
\begin{tikzpicture}
   \useasboundingbox (0,0) rectangle (0,0);
   \shade[top color=claro, bottom color=claro, middle color=oscuro]
   (0cm,-\paperheight) rectangle (\paperwidth+0.05cm,0cm);
\end{tikzpicture}%
%
\else%            Background for normal pages
%
\ifbeamer@plainframe%
\begin{tikzpicture}
   \useasboundingbox (0,0) rectangle (12.81,9.61);
\end{tikzpicture}%
\else%
%
\ifdefined\beamer@sidebarwidth%
%
%        Page with sidebar
%
\ifx\beamer@sidebarside\beamer@lefttext%
%
%  Sidebar left
%
\usebeamercolor{normal text}%
\begin{tikzpicture}
   \useasboundingbox (0,0) rectangle (12.81,9.61);
   \shade[top color=claro, bottom color=oscuro!75!black] (0,0) rectangle (12.81,9.61);
   \fill[color=bg,rounded corners=8pt] (\beamer@sidebarwidth+0.2cm,0.32cm) rectangle (\paperwidth-0.2cm,9.45cm-\beamer@headheight);%
%   \draw [color=oscuro!80!black,line width=1.7pt] (\beamer@sidebarwidth+0.5cm,9.61cm-\beamer@headheight)--(\paperwidth-0.5cm,9.61cm-\beamer@headheight);
\end{tikzpicture}
\else
%
%    Sidebar right
%
\begin{tikzpicture}
   \useasboundingbox (0,0) rectangle (12.81,9.61);
   \shade[top color=claro, bottom color=oscuro!75!black] (0,0) rectangle (12.81,9.61);
   \fill[color=white,rounded corners=8pt] (0.2cm,0.32cm) rectangle (\paperwidth-\beamer@sidebarwidth-0.2cm,9.45cm-\beamer@headheight);%
%   \draw [color=oscuro!80!black,line width=1.7pt] (0.5cm,9.61cm-\beamer@headheight)--(\paperwidth-\beamer@sidebarwidth-0.5cm,9.61cm-\beamer@headheight);
\end{tikzpicture}
\fi%
\setbeamertemplate{sidebar canvas \beamer@sidebarside}[vertical shading][top=palette primary.bg,bottom=palette primary.bg!40]%
\else
%
%     No sidebar
%
\usebeamercolor{normal text}%
\begin{tikzpicture}
   \useasboundingbox (0,0) rectangle (12.81,9.61);
   \shade[top color=claro, bottom color=oscuro] (0,0) rectangle (12.81,9.61);
   \ifbeamer@theme@section%    Sections on footline
      \fill[color=bg,rounded corners=8pt] (0.2,0.66) rectangle (12.6cm,9.35cm-\beamer@headheight);%
   \else%   No sections on footline
      \fill[color=bg,rounded corners=8pt]
      (0.2,0.32)
      rectangle %
           (12.6cm,9.35cm-\beamer@headheight);%
 %       (\paperwidth-0.2cm,9.45cm-\beamer@headheight);%
   \fi%
 %  \draw [color=oscuro!80!black,line width=1.7pt] (1.2cm,9.45cm-\beamer@headheight)--(11.6cm,9.45cm-\beamer@headheight);
\end{tikzpicture}
%\fi%
\fi%
%
\fi%
\fi%
}
%
%   ===================================   Headline     ===================================
%
\ifdefined\beamer@sidebarwidth\else%
\ifdim\beamer@headheight>0pt \defbeamertemplate*{headline}{cylinders theme}
  {%
   \begin{beamercolorbox}[wd=\paperwidth]{frametitle}
      \vrule width0pt height \beamer@headheight%
    \end{beamercolorbox}
  }
\else\defbeamertemplate*{headline}{cylinders theme}{}\fi\fi%


\setbeamertemplate{navigation symbols}{}

\mode
<all>
